﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Globalization;
using System.Threading;
using System.Resources;

namespace IDE_week_2
{
    public partial class Form1 : Form
    {
        bool buttonclicked=false;
        public Form1()
        {
            Thread.CurrentThread.CurrentUICulture = new CultureInfo("de");
            InitializeComponent();
        }

        private void button4_Click(object sender, EventArgs e)
        {
            Form2 myForm = new Form2();
            myForm.Show();
        }

        private void button1_Click(object sender, EventArgs e)
        {
           this.Icon=Properties.Resources.Icon1;
        }

        private void button2_Click(object sender, EventArgs e)
        {
            this.Icon=default(Icon);
        }

        private void button3_Click(object sender, EventArgs e)
        {
            if (buttonclicked==false)
            {
                ChangeLang("en");
                this.buttonclicked=true;
            }
            else
            {
                ChangeLang("de");
                this.buttonclicked=false;
            }
        }

           private void ChangeLang(string lang)
           {
               foreach (Control c in this.Controls)
               {
                   ComponentResourceManager resources= new ComponentResourceManager(typeof(Form1));
                   resources.ApplyResources(c,c.Name, new CultureInfo(lang));
               }
           }

        

        private void button5_Click(object sender, EventArgs e)
        {
            

        }

        private void button5_Click_1(object sender, EventArgs e)
        {
            int[] numbers = new int[10];
            Class1.MakeRandomNumber(numbers);
            label1.Text = numbers[0] + ", " + numbers[1] + ", " + numbers[2];
        }
    }
}
